package com.android.scsd.tiango.wxapi;
import android.content.Intent;
import android.widget.Toast;

import com.android.scsd.tiango.R;
import com.tencent.mm.sdk.modelbase.BaseResp;
import com.umeng.socialize.weixin.view.WXCallbackActivity;

public class WXEntryActivity extends WXCallbackActivity {
	@Override
	public void onResp(BaseResp resp) {
		super.onResp(resp);

		int result = 0;
		
		switch (resp.errCode) {
		case BaseResp.ErrCode.ERR_OK:
			result = R.string.errcode_success;
			sendBroadcast(new Intent("com.wx.result"));
			break;
		case BaseResp.ErrCode.ERR_USER_CANCEL:
			result = R.string.errcode_cancel;
			break;
		case BaseResp.ErrCode.ERR_AUTH_DENIED:
			result = R.string.errcode_deny;
			break;
		default:
			result = R.string.errcode_unknown;
			break;
		}
		
		//Toast.makeText(this, result, Toast.LENGTH_LONG).show();
		finish();
	
	}
}
